package daoImpl;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import dao.ErjiDao;
import dao.GoodsDao;
import entlty.Erji;
import entlty.ErjiVo;
import entlty.Goods;
import utils.BaseDao;

public class ErjiDaoImpl extends BaseDao implements ErjiDao{


	@Override
	public List<Erji> getAll(int e_id) {
		List<Erji> list=new ArrayList<Erji>();
		String sql="select * from erji where e_id=?";
		ResultSet rs=super.exeQuery(sql,e_id);
		
		try {
			while(rs.next()){
				Erji e=new Erji(rs.getInt(1),rs.getString(2),rs.getInt(3));
				list.add(e);
			}
		} catch (Exception e) {
			// TODO: handle exception
		}finally {
			super.closeAll(rs, super.ptmt, super.connction);
		}
		return list;
	}

	@Override
	public List<Erji> getAll() {
		List<Erji> list=new ArrayList<Erji>();
		String sql="select * from erji";
		ResultSet rs=super.exeQuery(sql);
		
		try {
			while(rs.next()){
				Erji e=new Erji(rs.getInt(1),rs.getString(2),rs.getInt(3));
				list.add(e);
			}
		} catch (Exception e) {
			// TODO: handle exception
		}finally {
			super.closeAll(rs, super.ptmt, super.connction);
		}
		return list;
	}

}
